from gevent import monkey
monkey.patch_all()
import internal.model
from flask_migrate import Migrate
from app.http.module import injector
from config import Config
from internal.router import Router
from internal.server import Http
from pkg.sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from internal.middleware import Middleware

config = Config()
app = Http(__name__, config=config, db=injector.get(SQLAlchemy), router=injector.get(Router),
           migrate=injector.get(Migrate), login_manager=injector.get(LoginManager), middleware=injector.get(Middleware))
if __name__ == "__main__":
    app.run(host='0.0.0.0', port=5000, debug=True)

celery = app.extensions["celery"]